package cn.yer.controller;

import cn.yer.entity.LayuiTableData;
import cn.yer.entity.Yhxx;
import cn.yer.service.HwysService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/hwys")
public class HwysController {
    @Autowired
    public HwysService hwysService;

    @ApiOperation(value = "分页运输用户", notes = "分页列表显示货物运输用户")
    @RequestMapping(value = "/pageYhxx",method = RequestMethod.GET)
    @ResponseBody
    public LayuiTableData queryAllYh(@RequestParam Integer page, @RequestParam Integer limit ){
        return hwysService.queryAllYh(page,limit);
    }
    @ApiOperation(value = "货物运输用户信息", notes = "查询货物运输用户信息")
    @RequestMapping(value = "/yhxx",method = RequestMethod.GET)
    @ResponseBody
    public List<Yhxx> queryAllYh(){
        return hwysService.yhxx();
    }

    @ApiOperation(value = "货物运输账目统计", notes = "根据用户查询账目")
    @RequestMapping(value = "/zmtj",method = RequestMethod.GET)
    @ResponseBody
    public JSONObject zmtj(@RequestParam String khxm){
        return hwysService.zmtj(khxm);
    }
}
